<?php

	$id =intval($_GET['id']);

	
	$data['post'] = get_post($id);
	//$data['user'] = cache_get_user($data['post']['username']);
	if($data['post']['album_id']){
		// LAY DU LIEU TRONG ALBUM
		$data['album']=album_get_list_item($data['post']['album_id']);
	}else{
		
		$data['related']=cache_get_related_post($data['post']['cat_id'],$data['post']['sub_id']);
	}

  	$data['userinfo']=cache_get_user($data['post']['username']);

   	if(!$data['post']){
   		//echo 'khong co data';
   		// redirect hoac lam gi do
		redirect(HOME);
   		exit();
   	}
   	
   
   	
	// CALCULATOR VIEW --------
	blog_view($data['post']['pid']);

	//HEADER TITLE,KEYWORD,DESCRIPION
			$og='<meta property="og:image" content="'.$data['post']['image_big'].'"/>
<meta property="og:locale" content="vi_VN" /> ';
   $data1['og']=$og;
	$data1['title']=$data['post']['title'];
	$data1['keyword']=$data['post']['title'].','.$data['post']['alias'];
	$data1['mota']=$data['post']['title'].' | Mong.vn';

loadview('template/header',$data1);
loadview("news/view",$data);

?>